<template>
	<view class="content">
		<view class="tab">
			<view class="tab1" v-for="(item,index) in tablist" @click="tabchange(item.id)"
				:style="{background:a==item.id?'#ffffff':'',color:a==item.id?'#409CFD':''}">
				<text>{{item.title}}</text>
			</view>
		</view>

		<view class="search">
			<image src="../../../static/home/search.png" mode=""></image>
			<input type="text" value="" placeholder="搜索" />
		</view>
		<view class="type" v-show="b">
			<view class="type1" v-for="(item,index) in type" @click="typechange(item.id)" :style="{color:c==item.id?'#409CFD':''}">
				<text>{{item.title}}</text>
			</view>
		</view>
		<view class="goods" v-for="(item,index) in goods">
			<view class="goods1">
				<image :src="item.img" mode=""></image>
			</view>
			<view class="goods2">
				<view class="goods2_t">
					<text>{{item.title}}</text>
				</view>
				<view class="goods2_b">
					进货价￥<text>{{item.price}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				a: 0,
				b:true,
				c:0,
				tablist:[{
						id: 0,
						title: '已上架商品'
					},
					{
						id: 1,
						title: '待上架商品'
					}
				],
				type: [{
						id: 0,
						title: '综合'
					},
					{
						id: 1,
						title: '销量'
					},
					{
						id: 2,
						title: '价格	'
					}
				],
				goods:[
					{
						id:0,
						img:'../../../static/my/shoplogo.png',
						title:'商品名称',
						price:199
					},
					{
						id:1,
						img:'../../../static/my/shoplogo.png',
						title:'商品名称',
						price:199
					}
				]
			}
		},
		onLoad() {
		this.b=true	
		},
		methods: {
			tabchange(id) {
				this.a = id
				if(this.a==0){
					this.b=true
				}else if(this.a==1){
					this.b=false
				}
			},
			typechange(id){
				this.c=id
			}
		}
	}
</script>

<style>
	.content {
		width: 750rpx;
		height: 1840rpx;
		background: #FAFAFA;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		padding-top: 32rpx;
	}

	.tab {
		width: 690rpx;
		height: 80rpx;
		background: #F0F1F3;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		margin: auto;
	}

	.tab1 {
		width: 320rpx;
		height: 64rpx;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #333333;
		display: flex;
		align-items: center;
		justify-content: center;
		margin: auto;
	}

	.search {
		display: flex;
		align-items: center;
		width: 690rpx;
		height: 88rpx;
		background: #FFFFFF;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		margin: 32rpx auto 0;
	}

	.search image {
		width: 34rpx;
		height: 34rpx;
		margin-left: 28rpx;
		margin-right: 24rpx;
	}

	.type {
		display: flex;
		justify-content: space-between;
		margin-left: 32rpx;
		margin-right: 32rpx;
		margin-top: 32rpx;
	}

	.type1 {

		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 28rpx;
		color: #666666;
	}

	.goods {
		width: 690rpx;
		height: 280rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 12rpx 20rpx 0rpx rgba(158, 158, 158, 0.04);
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		margin: 32rpx auto 0;
		display: flex;
		align-items: center;
	}

	.goods1 {margin-left: 32rpx;}

	.goods1 image {
		height: 216rpx;
		width: 216rpx;

	}

	.goods2 {
		height: 216rpx;
		margin-left: 32rpx;
	}

	.goods2_t {
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 32rpx;
		color: #333333;
	}

	.goods2_b {
		width: 216rpx;
		height: 64rpx;
		background: #3392F6;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 24rpx;
		color: #FFFFFF;
		margin-top: 108rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.goods2_b text{
		font-family: PingFang SC-Bold;
		font-weight: Bold;
		font-size: 40rpx;
		color: #FFFFFF;
	}
</style>